﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SetupLauncher.Domain.Logic.Environment
{
    internal static class PrepareFactory
    {
        public static IPrepareCommand Create(string product)
        {
            return Create(product, null);
        }

        public static IPrepareCommand Create(string product, Logger.ILoggable log)
        {
            if (string.IsNullOrEmpty(product))
                throw new ArgumentNullException("product");

            switch (product.ToLower())
            {
                case "sinacor":
                    return new PrepareSinacor(log);
                case "imercado":
                    return new PrepareIMercado(log);
                case "psecomponents":
                    return new PreparePSEComponents(log);
                case "pse":
                    return new PreparePSE(log);
            }
            throw new Exception(string.Format("O produto {0} não foi configurado", product));
        }
    }
}
